package com.ggambo.HandCoin.Advertising;

import android.app.Activity;
import android.app.ListActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.widget.ListView;
import com.ggambo.HandCoin.R;

import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: com
 * Date: 13. 1. 7
 * Time: 오후 10:57
 * To change this template use File | Settings | File Templates.
 */
public class Advertising_List extends Activity
{
    private ListView listView;
    public Advertising_Adapter adapter;
    public ArrayList<Advertising> advertisings_list;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);    //To change body of overridden methods use File | Settings | File Templates.
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.advertising_list);

        listView = (ListView)findViewById(R.id.ad_list);
        advertisings_list = new ArrayList<Advertising>();
        adapter = new Advertising_Adapter(this , R.layout.advertising , advertisings_list);

//
//        Advertising ad1 = new Advertising("500" , "김태희" , "가나다라마바사아자차카타파하 이거보면" +
//                    "얼마줄수있는데 얼마줄꺼야 얼마나 줄수있어 나는 잘생겼다고세번만말해봐" , R.drawable.ad_icon);
//        Advertising ad2 = new Advertising("500" , "김태희" , "가나다라마바사아자차카타파하 이거보면" +
//                    "얼마줄수있는데 얼마줄꺼야 얼마나 줄수있어 나는 잘생겼다고세번만말해봐" , R.drawable.ad_icon);
//
//        advertisings_list.add(ad1);
//        advertisings_list.add(ad2);

        Advertising ad;
        for(int i = 0 ; i < 30 ; i++)
        {
            ad = new Advertising("500" , "김태희" , "가나다라마바사아자차카타파하 이거보면" +
                    "얼마줄수있는데 얼마줄꺼야 얼마나 줄수있어 나는 잘생겼다고세번만말해봐" , R.drawable.ad_icon);
            advertisings_list.add(ad);
        }

        Log.e("가가가가"+listView, ""+adapter);
        listView.setAdapter(adapter);

    }
}
